package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishItemVO;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
    Integer getByid(Long id);


    List<Dish> page(DishPageQueryDTO dto);

    @AutoFill(OperationType.INSERT)
    void insert(Dish dish);

    List<DishVO> list(Long categoryId);

    Integer getstatusCont(List<Long> ids);

    void delete(List<Long> ids);

    Dish getDishByid(Long id);
    @AutoFill(OperationType.UPDATE)
    void update(Dish dish);

@Select("select count(*) from dish where status = #{status};")
    Integer getCount(Integer status);
}

